/**
 * 获取星期几（中文）
 * @param {Date|string} date 可被new Date()解析的时间
 * @returns {string} e.g. "星期一"
 */
export function getChineseWeekday(date) {
  const day = new Date(date).getDay();
  const weekdays = ['日', '一', '二', '三', '四', '五', '六'];
  return `星期${weekdays[day]}`;
}

/**
 * 获取星期几（英文缩写）
 * @param {Date|string} date 
 * @returns {string} e.g. "Mon"
 */
export function getShortWeekday(date) {
  const day = new Date(date).getDay();
  const weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
  return weekdays[day];
}